/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 逆袭人生
 * Date: 2024-08-21
 * Time: 11:20
 */
public class method1 {
    //方法的重载
    public static int add(int a,int b) {
        return a + b;
    }
    public static int add(int a,int b,int c) {
        return a + b;
    }
    public static double add(double a,double b) {
        return a + b;
    }
    public static void main(String[] args) {
/*        int x = 10;
        int y = 20;
        int ret = add(x,y);
        System.out.println(ret);

        double d1 = 12.3;
        double d2 = 12.5;
        add(d1,d2);*/
        System.out.println(add(1, 2));
        System.out.println(add(1.6, 1.7));
        System.out.println(add(1, 2, 4));

    }
}
